#!/usr/bin/env bash
## configure and install minimal bpswm desktop environment

echo 'AUTOSTRTX'

echo 'BSPWM'

echo 'MEDIA'

echo 'ARCHIV'
unzip zip lzip lzop squashfs-tools unar lrzip p7zip

echo 'CREO'

echo 'TERMINAL'

echo 'POLYBAR'

echo 'KEYBOARD'
doas mkdir -p /etc/X11/xorg.conf.d/
doas cp 00-keyboard.conf /etc/X11/xorg.conf.d/

echo 'NTP'
doas xbps-install ntp  
doas ln -s /etc/sv/ntpd /var/service 
doas sv up ntpd

echo 'OS-PROBER'
doas xbps-install os-prober  
doas echo GRUB_DISABLE_OS_PROBER=false >> /etc/default/grub  
doas update-grub

echo 'VIRT-MANAGER'
doas xbps-install virt-manager qemu bridge-utils dnsmasq  
doas usermod -aG kvm $USER  
doas usermod -aG libvirt $USER  
doas modprobe kvm-intel 
doas ln -s /etc/sv/libvirtd /var/service  
doas ln -s /etc/sv/virtlockd /var/service  
doas ln -s /etc/sv/virtlogd /var/service 

echo 'DMENU'
git clone https://git.suckless.org/dmenu  
cd dmenu  
patch < dmenu-xyw-5.0.diff  
sudo make clean install